package com.sea.base.ext.global

import android.app.Activity
import android.app.Service
import android.content.Intent
import android.os.Build
import android.os.Parcelable

inline fun <reified T : Activity> intentNew() = Intent(singleApplication, T::class.java)
inline fun <reified T : Service> intentNewService() = Intent(singleApplication, T::class.java)

inline fun <reified T : Parcelable> Intent.getParcelableExtraExt(key: String) =
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) this.getParcelableExtra(key, T::class.java)
    else getParcelableExtra(key)